package com.zr.useredu.mapper;


import com.zr.useredu.pojo.UserEdu;
import com.zr.useredu.pojo.UserEduAddVo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * Created by star on 2019/7/3.
 */
@Mapper
public interface UserEduMapper {
    @Insert("insert into useredu(occupation,education,graduationSchool,major,graduationYear,createTime,createName,updateTime," +
            "updateName) values (#{occupation},#{education},#{graduationSchool},#{major},#{graduationYear},#{createTime},#{createName},#{updateTime},#{updateName})")
    int addEducation(UserEdu userEdu);

    @Select("select id,occupation,education,graduationSchool,major,graduationYear from useredu where loginId=#{loginId}")
    UserEduAddVo queryLoginIdEdu(Integer loginId);

    @Update("update useredu set occupation=#{occupation},education=#{education},graduationSchool=#{graduationSchool},major=#{major}," +
            "graduationYear=#{graduationYear},updateTime=#{updateTime},updateName=#{updateName} where loginId=#{loginId}")
    int updateEducation(UserEdu userEdu);

}
